#include <header.h>

void my_read(int file_fd, char *buf,  int len){

    int size = 0;
    while(size < len){
        ssize_t ret = read(file_fd, buf+size, len-size);
        size += ret;
    }

}
int main(){

    int file_fd = open("1.txt", O_RDONLY);

    ssize_t num = 0;
    my_read(file_fd, (char *)&num, sizeof(ssize_t));

    char buf[100]= {0};
    my_read(file_fd, buf, num);
    printf("buf:%s \n", buf);


    close(file_fd);
    return 0;
}

